<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://dss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/js/lib/jquery-1-edb203c114.10.2.js"></script>
    <style>
       .imgbox {
            max-width: 400px;
        }
        #imgbox >img{
            width: 100%;
            height: auto;
        }
    </style>
</head>
<body>
<input id="aaaa" value="[CQ:image,file={FD03407F-E86E-3661-FFCA-7DB0CBA11CA4}.mirai,url=http://gchat.qpic.cn/gchatpic_new/885050208/813920989-2549822793-FD03407FE86E3661FFCA7DB0CBA11CA4/0?term=2]
    123">
<div class="imgbox">
    <img src="http://gchat.qpic.cn/gchatpic_new/885050208/813920989-2549822793-FD03407FE86E3661FFCA7DB0CBA11CA4/0?term=2"
         alt="">
</div>
<button onclick="f()">qqq</button>
<script>
    function f() {
        var a = "[CQ:image,file={FD03407F-E86E-3661-FFCA-7DB0CBA11CA4}.mirai,url=http://gchat.qpic.cn/gchatpic_new/885050208/813920989-2549822793-FD03407FE86E3661FFCA7DB0CBA11CA4/0?term=2]\n123";
        var b ="12345435456456";
        var patt1 = /\,url=(.*)\]/m;
        var patt = /\[CQ\:image\,file=.*\]/m;

        var regExpMatchArray = b.match(patt1);


        var txt = a.replace(patt, regExpMatchArray[1]);


    }
</script>
</body>
</html>